home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-12-07 | 18.5 KB | 1,006 lines |
- ############################################################################
- # #
- # 123.rul -- Decode It! rule file for Lotus Worksheet files #
- # #
- # #
- # Please note: This rule file is provided as an example only. While #
- # every effort has been made to validate the information #
- # presented here, Axiom Innovations takes no responsibility #
- # for the integrity of the data that results from using #
- # this example. #
- # #
- ############################################################################
-
-
- RECORD RECORD_123
-
- # 123 Record Header
-
- SHORT RecordType
-
- SHORT RecordLength
-
-
- # Beginning of File
- WHILE RECORD_123.RecordType <=> 0
- RECORD BeginOfFile
-
- # Id should equal 1028 or 1030
- XSHORT Id
-
- WHILE RECORD_123.BeginOfFile.Id <> 1028
- BEGIN
-
- WHILE RECORD_123.BeginOfFile.Id <> 1030
- EXIT
-
- END
-
- RETURN
-
- END
-
-
- # End of file
- WHILE RECORD_123.RecordType <=> 1
- RECORD EndOfFile
-
- # Decode bytes after Lotus EOF
- ASCII AfterEOF -1
-
- EXIT
-
- END
-
-
- # Calculation method
- WHILE RECORD_123.RecordType <=> 2
- BEGIN
-
- # 0 = manual mode, FF = automatic
- XTINY CalcMode
-
- RETURN
-
- END
-
-
- # Calculation order
- WHILE RECORD_123.RecordType <=> 3
- BEGIN
-
- # 0 = natural, 1 = by column, FF = by row
- XTINY CalcOrder
-
- RETURN
-
- END
-
-
- # Split window type
- WHILE RECORD_123.RecordType <=> 4
- BEGIN
-
- # 0 = not split, 1 = vertical split, FF = horizontal split
- XTINY SplitType
-
- RETURN
-
- END
-
-
- # Split window sync
- WHILE RECORD_123.RecordType <=> 5
- BEGIN
-
- # 0 = not synchronized, FF = synchronized
- XTINY SyncType
-
- RETURN
-
- END
-
-
- # Active worksheet range (start col, start row, end col, end row)
- WHILE RECORD_123.RecordType <=> 6
- BEGIN
-
- SHORT ActiveRange 4
-
- RETURN
-
- END
-
-
- # Window 1 and 2
- BEGIN
-
- WHILE RECORD_123.RecordType <> 7
- BEGIN
-
- WHILE RECORD_123.RecordType <> 9
- RESCIND
-
- END
-
- RECORD Window
-
- SHORT CursorPosition 2
-
- #####################################################################
- # #
- # Each bit of the cell format byte is used as follows: #
- # #
- # Bit Description Value Meaning #
- # --- ----------- ----- ------- #
- # 7 protection 1 protected #
- # 0 unprotected #
- # #
- # 4-6 format type 0 fixed #
- # 1 scientific notation #
- # 2 currency #
- # 3 percent #
- # 4 comma #
- # 5-6 unused #
- # 7 ** special ** (see below) #
- # #
- # 0-3 decimal places 0-15 ** Only if format type = 0-6 ** #
- # special format if format type = 7 : #
- # 0 +/- #
- # 1 general #
- # 2 day-month-year #
- # 3 day-month #
- # 4 month-year #
- # 5 text #
- # 6 hidden #
- # 7 date : hour-min-sec #
- # 8 date : hour-min #
- # 9 date : international 1 #
- # 10 date : international 2 #
- # 11 time : international 1 #
- # 12 time : international 2 #
- # 13-14 not used #
- # 15 default #
- # #
- #####################################################################
-
- XTINY Format
-
- TINY Unused1
-
- SHORT DefaultWidth
-
- SHORT ScreenSize 2
-
- SHORT StartPosition 2
-
- SHORT TitleSize 2
-
- SHORT TitleStart 2
-
- SHORT TopLeftPosition 2
-
- SHORT NumberCols
-
- TINY Unused2 2
-
- RETURN
-
- END RECORD_123.RecordLength
-
- END
-
-
- # Column width (for window 1)
- WHILE RECORD_123.RecordType <=> 8
- RECORD ColWidth1
-
- XSHORT Id
-
- XTINY Width
-
- RETURN
-
- END
-
-
- # Column width (for window 2)
- WHILE RECORD_123.RecordType <=> 10
- RECORD ColWidth2
-
- XSHORT Id
-
- XTINY Width
-
- RETURN
-
- END
-
-
- # Named range (start col, start row, end col, end row)
- WHILE RECORD_123.RecordType <=> 11
- RECORD NamedRange
-
- ASCII Name 16
- (OMIT0) RECORD_123.NamedRange.Name
-
- SHORT Range 4
-
- RETURN
-
- END
-
-
- # Blank Cell
- WHILE RECORD_123.RecordType <=> 12
- RECORD BlankCell
-
- # Cell Format (see above)
- XTINY Format
-
- SHORT Column
-
- SHORT Row
-
- RETURN
-
- END
-
-
- # Integer number cell
- WHILE RECORD_123.RecordType <=> 13
- RECORD Integer
-
- # Cell Format (see above)
- XTINY Format
-
- SHORT Column
-
- SHORT Row
-
- SHORT Value
-
- RETURN
-
- END
-
-
- # Floating point number
- WHILE RECORD_123.RecordType <=> 14
- RECORD Number
-
- # Cell Format (see above)
- XTINY Format
-
- SHORT Column
-
- SHORT Row
-
- DFLOAT Value
-
- RETURN
-
- END
-
-
- # Label cell
- WHILE RECORD_123.RecordType <=> 15
- RECORD Label
-
- # Cell Format (see above)
- XTINY Format
-
- SHORT Column
-
- SHORT Row
-
- # Label format prefix:
- # | = printer command, \ = repeating, ' = left alignment,
- # " = right alignment, ^ = centered.
- ASCII LabelPrefix
-
- ASCII Label -1
-
- RETURN
-
- END RECORD_123.RecordLength
-
-
- # Formula cell
- WHILE RECORD_123.RecordType <=> 16
- RECORD Formula
-
- # Cell Format (see above)
- XTINY Format
-
- SHORT Column
-
- SHORT Row
-
- DFLOAT Value
-
- SHORT Size
-
- # Formulas are stored in postfix (reverse polish) notation
- RECORD Postfix -1
-
- #### The most frequently used operations are indicated ####
-
- XTINY OpCode
-
- WHILE RECORD_123.Formula.Postfix.OpCode <=> 0
- DFLOAT Constant
-
- WHILE RECORD_123.Formula.Postfix.OpCode <=> 1
- RECORD Variable
-
- # A '1' in bit 15 indicates relative cell reference
- # A '0' in bit 15 indicates absolute cell reference
- XSHORT Coordinate 2
-
- END
-
- WHILE RECORD_123.Formula.Postfix.OpCode <=> 2
-
- # (start col, start row, end col, end row)
- XSHORT Range 4
-
-
- #### Use RECORDs to indicate the type of operation ####
-
- WHILE RECORD_123.Formula.Postfix.OpCode <=> 3
- RECORD __Return__
-
- RETURN
-
- END
-
- WHILE RECORD_123.Formula.Postfix.OpCode <=> 4
- RECORD __Parenthesis__
-
- BREAK
-
- END
-
- WHILE RECORD_123.Formula.Postfix.OpCode <=> 5
- SHORT Integer
-
- WHILE RECORD_123.Formula.Postfix.OpCode <=> 6
- RECORD StringConstant
-
- UNDEFINE RECORD_123.Formula.Postfix.StringConstant.Data
-
- WHILE RECORD_123.Formula.Postfix.StringConstant.Data <> 0
- ASCII Data -1
-
- END
-
- WHILE RECORD_123.Formula.Postfix.OpCode <=> 8
- RECORD __Negate__
-
- BREAK
-
- END
-
- WHILE RECORD_123.Formula.Postfix.OpCode <=> 9
- RECORD __Add__
-
- BREAK
-
- END
-
- WHILE RECORD_123.Formula.Postfix.OpCode <=> 10
- RECORD __Subtract__
-
- BREAK
-
- END
-
- WHILE RECORD_123.Formula.Postfix.OpCode <=> 11
- RECORD __Multiply__
-
- BREAK
-
- END
-
- WHILE RECORD_123.Formula.Postfix.OpCode <=> 12
- RECORD __Divide__
-
- BREAK
-
- END
-
- WHILE RECORD_123.Formula.Postfix.OpCode <=> 13
- RECORD __Exponent__
-
- BREAK
-
- END
-
-
- WHILE RECORD_123.Formula.Postfix.OpCode <=> 14
- RECORD __Equal__
-
- BREAK
-
- END
-
- WHILE RECORD_123.Formula.Postfix.OpCode <=> 15
- RECORD __NotEqual__
-
- BREAK
-
- END
-
- WHILE RECORD_123.Formula.Postfix.OpCode <=> 16
- RECORD __LessOrEqual__
-
- BREAK
-
- END
-
- WHILE RECORD_123.Formula.Postfix.OpCode <=> 17
- RECORD __GreatOrEqual__
-
- BREAK
-
- END
-
- WHILE RECORD_123.Formula.Postfix.OpCode <=> 18
- RECORD __LessThan__
-
- BREAK
-
- END
-
- WHILE RECORD_123.Formula.Postfix.OpCode <=> 19
- RECORD __GreaterThan__
-
- BREAK
-
- END
-
- WHILE RECORD_123.Formula.Postfix.OpCode <=> 20
- RECORD __And__
-
- BREAK
-
- END
-
- WHILE RECORD_123.Formula.Postfix.OpCode <=> 21
- RECORD __Or__
-
- BREAK
-
- END
-
- WHILE RECORD_123.Formula.Postfix.OpCode <=> 22
- RECORD __Not__
-
- BREAK
-
- END
-
- WHILE RECORD_123.Formula.Postfix.OpCode <=> 47
- RECORD __Mod__
-
- BREAK
-
- END
-
- WHILE RECORD_123.Formula.Postfix.OpCode <=> 55
- RECORD __Today__
-
- BREAK
-
- END
-
- WHILE RECORD_123.Formula.Postfix.OpCode <=> 59
- RECORD __If__
-
- BREAK
-
- END
-
- WHILE RECORD_123.Formula.Postfix.OpCode <=> 80
- RECORD __Sum__
-
- BREAK
-
- END
-
- WHILE RECORD_123.Formula.Postfix.OpCode <=> 81
- RECORD __Avg__
-
- BREAK
-
- END
-
- WHILE RECORD_123.Formula.Postfix.OpCode <= 47
- NEXT
-
-
- #### Filter variable argument opcodes ####
- BEGIN
-
- BEGIN
-
- # CHOOSE
- WHILE RECORD_123.Formula.Postfix.OpCode <=> 48
- BREAK
-
- # Statistical functions
- WHILE RECORD_123.Formula.Postfix.OpCode >= 80
- BEGIN
-
- WHILE RECORD_123.Formula.Postfix.OpCode <= 84
- RESCIND
-
- END
-
- # VAR
- WHILE RECORD_123.Formula.Postfix.OpCode <=> 87
- BREAK
-
- # STD
- WHILE RECORD_123.Formula.Postfix.OpCode <=> 88
- BREAK
-
- # INDEX
- WHILE RECORD_123.Formula.Postfix.OpCode <=> 98
- BREAK
-
- # All non-variable argument functions
- RESCIND
-
- END
-
- XTINY ArgCount
-
- END
-
- END
-
- RETURN
-
- END RECORD_123.RecordLength
-
-
- # Table range (start col, start row, end col, end row)
- WHILE RECORD_123.RecordType <=> 24
- RECORD TableRange
-
- # 0 = no table, 1 = table 1, 2 = table 2
- XTINY TableID
-
- SHORT Range 4
-
- SHORT InputCell1 4
-
- SHORT InputCell2 4
-
- RETURN
-
- END
-
-
- # Query range (start col, start row, end col, end row)
- WHILE RECORD_123.RecordType <=> 25
- RECORD QueryRange
-
- SHORT InputRange 4
-
- SHORT OutputRange 4
-
- SHORT CriteriaRange 4
-
- # 0 = no command, 1 = find, 2 = extract, 3 = delete, 4 = unique
- XTINY Command
-
- RETURN
-
- END
-
-
- # Print Range (start col, start row, end col, end row)
- WHILE RECORD_123.RecordType <=> 26
- BEGIN
-
- SHORT PrintRange 4
-
- RETURN
-
- END
-
-
- # Sort Range (start col, start row, end col, end row)
- WHILE RECORD_123.RecordType <=> 27
- BEGIN
-
- SHORT SortRange 4
-
- RETURN
-
- END
-
-
- # Fill Range (start col, start row, end col, end row)
- WHILE RECORD_123.RecordType <=> 28
- BEGIN
-
- SHORT FillRange 4
-
- RETURN
-
- END
-
-
- # Primary and secondary sort key range (start col, start row, end col, end row)
- BEGIN
-
- WHILE RECORD_123.RecordType <> 29
- BEGIN
-
- WHILE RECORD_123.RecordType <> 35
- RESCIND
-
- END
-
- SHORT KeyRange 4
-
- # 0 = descending, FF = ascending order
- XTINY SortOrder
-
- RETURN
-
- END
-
-
- # Distribution Range (start col, start row, end col, end row)
- WHILE RECORD_123.RecordType <=> 32
- RECORD DistributeRange
-
- SHORT ValuesRange 4
-
- SHORT BinRange 4
-
- RETURN
-
- END
-
-
- # Global protection
- WHILE RECORD_123.RecordType <=> 36
- BEGIN
-
- # 0 = off, 1 or FF = on
- XTINY ProtectFlag
-
- RETURN
-
- END
-
-
- # Print footer
- WHILE RECORD_123.RecordType <=> 37
- RECORD PrintFooter
-
- ASCII Data 242
-
- RETURN
-
- END
- (OMIT0) RECORD_123.PrintFooter
-
-
- # Print header
- WHILE RECORD_123.RecordType <=> 38
- RECORD PrintHeader
-
- ASCII Data 242
-
- RETURN
-
- END
- (OMIT0) RECORD_123.PrintHeader
-
-
- # Printer setup string
- WHILE RECORD_123.RecordType <=> 39
- RECORD PrintSetUp
-
- ASCII Data 40
-
- RETURN
-
- END
- (OMIT0) RECORD_123.PrintSetUp
-
- # Margins (left, right, page length, top, bottom)
- WHILE RECORD_123.RecordType <=> 40
- BEGIN
-
- SHORT Margins 5
-
- RETURN
-
- END
-
-
- # Global label alignment
- WHILE RECORD_123.RecordType <=> 41
- BEGIN
-
- # 27h = left, 22h = right, 5Eh = center
- XTINY LabelAlignment
-
- RETURN
-
- END
-
-
- # PrintBorders (start col, start row, end col, end row)
- WHILE RECORD_123.RecordType <=> 42
- RECORD PrintBorders
-
- SHORT RowRange 4
-
- SHORT ColRange 4
-
- RETURN
-
- END
-
-
- # Graph settings (named or current)
- WHILE RECORD_123.RecordType >= 45
- BEGIN
-
- WHILE RECORD_123.RecordType <= 46
- RECORD GraphSettings
-
- # Label of Named Graph Setting
- WHILE RECORD_123.RecordType <=> 46
- ASCII Name 16
- (OMIT0) RECORD_123.GraphSettings.Name
-
- #### Ranges are of the form: (start col, start row, end col, end row) ####
-
- RECORD Ranges 7
-
- SHORT Range 4
-
- END
-
- RECORD Labels 6
-
- SHORT LabelRange 4
-
- END
-
- # 0 = XY, 1 = bar, 2 = pie, 4 = line, 5 = stacked bar
- XTINY GraphType
-
- # 0 = none, 1 = horizontal, 2 = vertical, 3 = both
- XTINY Grid
-
- XTINY ColorFlag
-
- # 0 = none, 1 = line, 2 = symbol, 3 = line-symbol
- XTINY LineFormats 6
-
- # 0 = center, 1 = right, 2 = below, 3 = left, 4 = above
- XTINY Alignments 6
-
- RECORD XYAxis 2
-
- # 0 = auto, FF = manual
- XTINY ScaleFlag
-
- DFLOAT Limits 2
-
- END
-
- RECORD Titles 4
-
- ASCII Title 40
-
- END
- (OMIT0) RECORD_123.GraphSettings.Titles
-
- RECORD Legends 6
-
- ASCII Legend 20
-
- END
- (OMIT0) RECORD_123.GraphSettings.Legends
-
- # Cell Format (see above)
- XTINY XFormat
-
- # Cell Format (see above)
- XTINY YFormat
-
- SHORT SkipFactor
-
- XTINY Extra -1
-
- RETURN
-
- END RECORD_123.RecordLength
-
- END
-
-
- # Iteration count
- WHILE RECORD_123.RecordType <=> 47
- BEGIN
-
- TINY CalcCount
-
- RETURN
-
- END
-
-
- # Print format mode
- WHILE RECORD_123.RecordType <=> 48
- BEGIN
-
- # 0 = formatted, 1 or FF = unformatted
- XTINY PrintFormat
-
- RETURN
-
- END
-
-
- # Cursor location
- WHILE RECORD_123.RecordType <=> 49
- BEGIN
-
- # 1 = window 1, 2 = window 2
- XTINY CursorWindow
-
- RETURN
-
- END
-
-
- # String formula
- WHILE RECORD_123.RecordType <=> 51
- RECORD StringFormula
-
- # Cell Format (see above)
- XTINY Format
-
- SHORT Column
-
- SHORT Row
-
- ASCII Label -1
-
- RETURN
-
- END RECORD_123.RecordLength
-
-
- # Symphony named range (start col, start row, end col, end row)
- WHILE RECORD_123.RecordType <=> 71
- RECORD SymphonyRange
-
- ASCII Name 16
- (OMIT0) RECORD_123.SymphonyRange.Name
-
- SHORT Range 4
-
- # 0 = single cell, 1 or FFh = range
- XTINY RangeType
-
- RETURN
-
- END
-
-
- # Worksheet password
- WHILE RECORD_123.RecordType <=> 75
- RECORD Password
-
- XTINY Encrypt -1
-
- RETURN
-
- END RECORD_123.RecordLength
-
-
- # Hidden columns 1 and 2
- WHILE RECORD_123.RecordType >= 100
- BEGIN
-
- WHILE RECORD_123.RecordType <= 101
- RECORD HiddenColumns
-
- # Each bit indicates if a column is hidden (1) or not (0)
- XTINY HiddenFlags 32
-
- RETURN
-
- END
-
- END
-
-
- # Parse ranges (start col, start row, end col, end row)
- WHILE RECORD_123.RecordType <=> 102
- RECORD ParseRanges
-
- SHORT InputRange 4
-
- SHORT OutputRange 4
-
- RETURN
-
- END
-
-
- # Linear regression ranges (start col, start row, end col, end row)
- WHILE RECORD_123.RecordType <=> 103
- RECORD LinearRegression
-
- SHORT DependVarRange 4
-
- SHORT IndependVarRange 4
-
- SHORT OutputRange 4
-
- # 0 = no forced zero-intercept, FFh = forced intercept at origin
- XTINY ZeroInterceptFlg
-
- RETURN
-
- END
-
-
- # Matrix mathematics ranges (start col, start row, end col, end row)
- WHILE RECORD_123.RecordType <=> 105
- RECORD MatrixRanges
-
- SHORT InversionSource 4
-
- SHORT InversionDest 4
-
- SHORT Multiplicand 4
-
- SHORT MultiplierRange 4
-
- SHORT ProductRange 4
-
- RETURN
-
- END
-
-
- # Cell pointer index
- WHILE RECORD_123.RecordType <=> 150
- RECORD CellPointerIndex
-
- REPEAT
-
- SHORT Column
-
- SHORT FirstRow
-
- SHORT LastRow
-
- END
-
- RETURN
-
- END RECORD_123.RecordLength
-
-
- # Unknown (maybe Symphony?) record
- TINY unknown RECORD_123.RecordLength
-
- END
-